package com.medium.house.service;

import com.medium.house.entity.HouseInfo;
import com.medium.house.repository.HouseInfoMapper;
import com.medium.house.response.HouseOverView;
import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface HouseInfoService
{
    int DESC = 0;
    int ASC = 1;

    int add(HouseInfo dto);

    int delete(long id);

    int update(HouseInfo dto);

    HouseInfo get(long id);

    List<HouseInfo> getByPage(
            int start,
            int limit,
            int orderby,
            int order,
            int type,
            int status,
            String openid,
            String title);

    List<Long> getIdsByPage(
            int start,
            int limit,
            int orderby,
            int order);

    long count(int type,
               int status,
               String openid,
               String title);

    List<HouseOverView> getByPageToOverView(
            int start,
            int limit,
            int orderby,
            int order,
            int type,
            int status,
            String openid,
            String title
    );
    List<Long> getIdsByPageToOverView(
            int start,
            int limit,
            int orderby,
            int order);
    long countToOverView(        int type,
                                        int status,
                                        String openid,
                                        String title);

    /**
     *
     * @param start
     * @param limit
     * @param orderby
     * @param order
     * @param type 类型 1-二手房 2-出租房
     * @param status 状态 状态:1-启用 2-禁用 3-删除
     * @param openid openid
     * @param title 标题
     * @param layout 布局
     * @param region 区域
     * @param price 价格
     * @param lease 出租类型
     * @return
     */
    List<Map<String,Object>> getByPageToOverViewForJoin(int start,
                                                               int limit,
                                                               int orderby,
                                                               int order,
                                                               int type,
                                                               int status,
                                                               String openid,
                                                               String title,
                                                               String layout,
                                                               String region,
                                                               String price,
                                                               String lease);

    Map get(long id,int status);

}